/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * main.c
 * Copyright (C) 2012 Kellerman Rivero <krsloco@gmail.com>
 * 
 * kserver is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * kserver is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <stdio.h>
#include "util.h"
#include "sala.h"
#include "jugador.h"

int main()
{
	Sala *sala = Sala_Crear (1,100,NULL,NULL);

	Lista_Inicializar (LISTA(sala->jugadores));
	
	Jugador *jugador = Jugador_Crear (2,"johana","sjrt",19,99,2000,1,2,3,NULL);
	Lista_InsertarInicio(LISTA(sala->jugadores),NODO(jugador));
	
	jugador=Jugador_Crear (1,"kellerman","kelito",22,99,2000,1,2,3,NULL);
	Lista_InsertarInicio(LISTA(sala->jugadores),NODO(jugador));
	
	Lista_Imprimir (LISTA(sala->jugadores),Jugador_Imprimir);	
	int indice, resultado;
	
	Lista_Eliminar (LISTA(sala->jugadores),NODO(jugador),Jugador_Comparar,&resultado);

	printf("%d\n",resultado);
	Lista_Imprimir (LISTA(sala->jugadores),Jugador_Imprimir);
	
	Sala_Imprimir (sala);
	
	return (0);
}
